package com.itheima.demo;

public class Java_03 {
    public static void main(String[] args) {
        //数组的遍历
        //先定义一个数组
//        int[] arry = {10,20,30,40};
//        for (int i = 0; i < 4; i++) {
//            System.out.println(arry[i]);
//        }
        //数组案例：计算员工的总工资
        int[] money = new int[]{10,20,30,40,50};
        //使用for循环来遍历这个数组
        int sum = 0;
        for (int i = 0; i < money.length; i++) {
            sum += money[i];
        }
        System.out.println("员工工资的总和是：" + sum);

    }
}
